perf(toDash): Hoist duplicates from Representation to AdaptationSet #431
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
According to the DASH specification,
codecs
,audioSampleRate
,frameRate
andAudioChannelConfiguration
are all allowed to appear at theAdaptationSet
level not just theRepresentation
one. We can use that to slightly reduce the size of the manifests by specifying it on theAdaptationSet
, instead of eachRepresentation
, if the value would be identical for everyRepresentation
in thatAdaptationSet
.Examples of situations that can be useful in:
opus
,vp9
andvp9.2
(HDR), so it makes sense to hoist thecodecs
attributevp9.2
streams all tend to keep the original60fps
frame rates, so it makes sense to hoist theframeRate
attributeThis doesn't massively reduce the size of the manifests, as the majority of the size is occupied by YouTube's very long streaming URLs. I do have an idea I want to try though, having a
BaseURL
element at theAdaptationSet
level with a common prefix for the URLs in theBaseURL
s in theRepresenation
, this will need lots of experimentation, as developer specifiedURLTransformer
function could produce all sorts of wacky URLs. Another thing to watch out for is OTF formats, as they use SegmentTemplates instead of specifying aBaseURL
but would still be affected byBaseURL
elements on the AdaptationSet.TL;DR: The streaming URLs are the biggest contributor to the manifest size, I have an idea to shrink them but will need a lot of experimentation so it doesn't break anything.